import request from '@/utils/request'
import {CorpPersonForm, ParamsType} from './types'

/**
 * 获取企业人员列表
 */
export function getCorpPersonList(data: ParamsType) {
  return request({
    url: "/api/v1/corp/person/page",
    method: "get",
    params: data,
  });
}

/**
 * 获取企业人员信息
 */
export function getCorpPersonInfo(id: number) {
  return request({
    url: `api/v1/corp/person/form/${id}`,
    method: "get",
  });
}

/**
 * 新增企业人员
 */
export function addCorpPerson(data: CorpPersonForm) {
  return request({
    url: "/api/v1/corp/person/create",
    method: "post",
    data: data,
  });
}

/**
 * 修改企业人员信息
 */
export function editCorpPerson(id: number, data: CorpPersonForm) {
  return request({
    url: "/api/v1/corp/person/" + id,
    method: "put",
    data: data,
  });
}

/**
 * 删除企业人员信息
 */
export function deleteCorpPerson(id: number) {
  return request({
    url: "/api/v1/corp/person/" + id,
    method: "delete",
  });
}
